﻿using BW.Rabbit.Domain;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BW.Rabbit.Infrasttucture
{
    public class RedisDbContext : DbContext
    {
        public RedisDbContext(DbContextOptions options) : base(options)
        {
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            
            modelBuilder.Entity<GoodsInfo>().ToTable("GoodsInfo");
            modelBuilder.Entity<GoodsInfo>().HasKey(x => x.GoodsInfoId);
            modelBuilder.Entity<GoodsInfo>().Property(x => x.Image).IsRequired().HasMaxLength(50);
        }

    }
}
